import dbus
import dbus.glib
import gobject

class Rhythmbox:
	def __init__(self):
		bus = dbus.SessionBus()
		rbshellobj = bus.get_object("org.gnome.Rhythmbox", 
			"/org/gnome/Rhythmbox/Shell")
		self.rbshell = dbus.Interface(rbshellobj, 
			"org.gnome.Rhythmbox.Shell")

		rbplayerobj = bus.get_object("org.gnome.Rhythmbox",
			"/org/gnome/Rhythmbox/Player")
		self.rbplayer = dbus.Interface(rbplayerobj, 
			"org.gnome.Rhythmbox.Player")
	def playFile(self, file):
		self.rbshell.loadURI(file, True)
	def playPause(self, flag):
		self.rbplayer.playPause(flag)
	def getLibraryFile(self):
		return "/home/nax/.gnome2/rhythmbox/rhythmdb.xml"
